package com.crud.controller;
import com.crud.pojo.Department;
import com.crud.pojo.Msg;
import com.crud.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.sound.midi.Soundbank;
import java.util.List;

/**
 * @Author sc
 * @ClassName 处理部门有关业务
 * @Description class function:
 * @Date 2022/4/8 19:33:55
 **/

@Controller
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("/depts")
    @ResponseBody
    public Msg getDepts() {

        List<Department> list = departmentService.getDepts();
        return  new Msg().success().add("depts",list);
    }


}
